import { saveOrUpdate } from './api'
import { ListVO } from './data'

// 新增
export const add = async (formData: ListVO) => {
  const { title, content, answer, difficulty, questionCategoryId, tagIdList, status, isVip } = formData
  const res = await saveOrUpdate({ title, content, answer, difficulty, questionCategoryId, tagIdList, status, isVip })
  return res.code === 0
}
// 更新
export const update = async (formData: ListVO) => {
  const { title, content, answer, difficulty, questionCategoryId, tagIdList, status, isVip, id } = formData
  const res = await saveOrUpdate({ title, content, answer, difficulty, questionCategoryId, tagIdList, status, isVip, id })
  return res.code === 0
}
